package me.xplabs 
{
	import me.xplabs.constant.SceneType;
	import me.xplabs.controller.RaidInfoCommand;
	import me.xplabs.controller.SelectRaidCommand;
	import me.xplabs.controller.TryAgainCommand;
	import me.xplabs.model.LoaderMapCommand;
	import me.xplabs.model.MMapManagerCommand;
	import me.xplabs.model.proxy.LoaderMapProxy;
	import me.xplabs.msg.NotificationName;
	import me.xplabs.scene.EndSceneMediator;
	import me.xplabs.scene.GameSceneMediator;
	import me.xplabs.scene.LoaderSceneMediator;
	import me.xplabs.scene.SceneCommand;
	import me.xplabs.scene.SelectSceneMediator;
	import me.xplabs.scene.StartSceneMediator;
	import me.xplabs.view.FloatingBoxMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author xiaohan
	 */
	public class ApplicationCommand extends SimpleCommand 
	{
		
		public function ApplicationCommand() 
		{
			
		}
		override public function execute(notification:INotification):void 
		{
			facade.registerCommand(NotificationName.CHANGE_SCENE, SceneCommand);
			facade.registerCommand(NotificationName.LOADER_MAP_COMPLETE, LoaderMapCommand);
			facade.registerCommand(NotificationName.SELECTED_RAID, SelectRaidCommand);
			facade.registerCommand(NotificationName.FIGHT_MAP_MANAGER, MMapManagerCommand);
			facade.registerCommand(NotificationName.UPDATE_RAIDINFO, RaidInfoCommand);
			facade.registerCommand(NotificationName.TRY_ANGIN_GAME, TryAgainCommand);
			
			facade.registerMediator(new LoaderSceneMediator(notification.getBody()));
			facade.registerMediator(new StartSceneMediator(notification.getBody()));
			facade.registerMediator(new SelectSceneMediator(notification.getBody()));
			facade.registerMediator(new GameSceneMediator(notification.getBody()));
			facade.registerMediator(new EndSceneMediator(Globals.uiLayer));
			facade.registerMediator(new FloatingBoxMediator(Globals.uiLayer));
			
			
			sendNotification(NotificationName.CHANGE_SCENE, SceneType.LOADER_SCENE);
		}
	}

}